package com.example.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;

@Component
public class Aspect {
    @Pointcut("execution(* com.example.service..*.*(..))")
    public void pt(){
        System.out.println("");
    }

    public void methodBefore(JoinPoint joinPoint){
        Object[] args = joinPoint.getArgs();
        Object target = joinPoint.getTarget();
        MethodSignature signature = (MethodSignature) joinPoint.getSignature();

        System.out.println("Before");
    }

    public void methodAfterReturning(JoinPoint joinPoint, Object ret){
        System.out.println("AfterReturning: "+ ret);
    }

}
